package ysq.xyg.web.model.po;

import lombok.NoArgsConstructor;

import lombok.Data;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;
import ysq.xyg.sys.model.po.SysUser;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;


/**
 * 业务模块-我要报名实体类
 *
 * @author shengQiang yu
 * @date 2019-4-25 16:05:25
 */
@Data
@NoArgsConstructor
@Table(name = "xyg_web_sign_up")
public class WebSignUp implements Serializable{

	/**
     * 主键
     */ 
	@Id
	private String id;
	
	/**
     * 标题
     */ 
	@Column(name = "title")
	private String title;
	
	/**
     * 报名类型：1、活动预约
     */ 
	@Column(name = "type")
	private String type;
	
	/**
     * 封面图片
     */ 
	@Column(name = "picture")
	private String picture;
	/**
	 * 用户类型：1、成人，2、儿童
	 */
	@Column(name = "user_type")
	private String userType;
	/**
     * 开始日期
     */ 
	@Column(name = "start_date")
	private Date startDate;
	
	/**
     * 截止日期
     */ 
	@Column(name = "end_date")
	private Date endDate;
	
	/**
     * 内容
     */ 
	@Column(name = "content")
	private String content;
	
	/**
     * 状态：1、有效，2、无效
     */ 
	@Column(name = "status")
	private String status;
	/**
	 * 最小年龄
	 */
	@Column(name = "start_age")
	private int startAge;
	/**
	 * 最大年龄
	 */
	@Column(name = "end_age")
	private int endAge;
	/**
     * sort
     */ 
	@Column(name = "sort")
	private String sort;
	
	/**
     * 删除标注:1、正常，2、删除
     */ 
	@Column(name = "remove_tag")
	private String removeTag;
	
	/**
     * 创建时间
     */ 
	@Column(name = "create_time")
	private Date createTime;
	
	/**
     * 创建人
     */ 
	@Column(name = "create_user")
	private String createUser;
	
	/**
     * 修改时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;
	
	/**
     * 修改人
     */ 
	@Column(name = "update_user")
	private String updateUser;

	/**
	 * 报名人数
	 */
	@Transient
	private int memberNum;
	public WebSignUp(SysUser sysUser) {
		this.id= BaseUtil.uId();
		this.removeTag= BaseConstant.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}
}